package com.usian.mapper;

import com.usian.pojo.Etc;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface EtcMapper {

    List<Etc> findAll(Etc etc);

    @Delete("delete from etc where id = #{id}")
    void del(Integer id);

    @Insert("INSERT INTO etc(id, car, code, price, name, date) VALUES (#{id},#{car}, #{code},#{price},#{name},#{date})")
    void add(Etc etc);

    @Select("select * from etc where id = #{id}")
    Etc findById(Integer id);

    @Update("UPDATE etc SET car =#{car}, code = #{code}, price = #{price}, name =#{name}, date = #{date} WHERE id = #{id}")
    void update(Etc etc);

}
